﻿<%@ Page Title="" Language="C#" MasterPageFile="~/View/Main.Master" EnableEventValidation="false" AutoEventWireup="true" CodeBehind="BiddingInfoPage.aspx.cs" Inherits="ArtClub.View.BiddingPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainMenu" runat="server">
    <li><a href="BrowseCatalogue.aspx">Art Pieces</a>
    </li>
    <li><a href="BiddingInfoPage.aspx">Pieces for Bidding</a>
    </li>
    <li><a href="ChangeSystemDatePage.aspx">Subscription</a>
    </li>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PageName" runat="server">
    Available Pieces
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Submenu" runat="server">
    <a href="BrowseCatalogue.aspx" class="list-group-item">Catalogue</a>

</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="MainContent" runat="server">
    <script type="application/javascript">
        var i = 0;
    </script>
    <form id="form1" runat="server">

        <br />
        <table id="biddingInfoTable" class="table table-hover">


            <asp:Repeater ID="repBidding" runat="server" OnItemDataBound="repBidding_ItemDataBound">
                <HeaderTemplate>
                    <tr class="row">
                        <td>
                            <div class="col-xs-6 col-md-2">Image</div>
                        </td>
                        <td>
                            <div class="col-xs-6 col-md-2">Piece</div>
                        </td>
                        <td>
                            <div class="col-xs-6 col-md-2">Description</div>
                        </td>
                        <td>
                            <div class="col-xs-6 col-md-2">Highest Bid(kr)</div>
                        </td>
                        <td>
                            <div class="col-xs-6 col-md-2">Remaining Time</div>
                        </td>
                       <%-- <td>
                            <div class="col-xs-6 col-md-2">Bid Now</div>
                        </td>--%>
                    </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr class="row" id ="auctionRow">
                        <td>
                            <a href="BiddingPage.aspx?id=<%#Eval("id")%>"><asp:Image ID="imgPiece" runat="server" /></a>
                            
                        </td>
                        <td>
                            <div class="col-xs-6 col-md-4">
                                <b><%#Eval("Piece.name")%></b>
<%--                                <span style="font-size: 9px; color: #808080">Artist:
                                <%#Eval("Piece.artist")%></span>
                                <span style="font-size: 9px; color: #808080">Start Price:
                                <%#Eval("minBiddingPrice")%></span>
                                <span style="font-size: 9px; color: #808080">Increment:
                                <%#Eval("biddingStep")%>Kr/time</span>--%>
                            </div>
                        </td>
                        <td>
                            <div class="col-xs-6 col-md-2" style="font-size: 9px; color: #808080"><%#Eval("Piece.description")%></div>

                        </td>
                        <td>
                            <div data-id="<%#Eval("id")%>" class="col-xs-6 col-md-2 highestBidDiv"><%#Eval("highestBid")%></div>


                        </td>
                        <td>
                            <div id="timer" class="col-xs-6 col-md-2" runat="server"></div>
                            <div id="endTime" class="col-xs-6 col-md-2" runat="server" style="display: none"><%#Eval("endTime")%></div>
                            <script type="application/javascript">
                                var currentDate = Date.now();
                                var endTime = $("#MainContent_repBidding_endTime_" + i).text();

                                var timeDifference = endTime - currentDate;
                                var ss = Math.floor(timeDifference / 1000);
                                //var string = $("#MainContent_timer").text();
                                var myCountdownTest = new Countdown({
                                    time: ss, width: 100, height: 40, rangeHi: 'minute'
                                });
                                i++;
                            </script>

                        </td>
                       <%-- <td>
                            <div id="time" class="col-xs-6 col-md-2">
                                <asp:Button ID="btnBid" runat="server" Text="Bid" OnClick="btnBid_Click" />
                            </div>

                        </td>--%>
                    </tr>
                </ItemTemplate>
            </asp:Repeater>

        </table>
    </form>
</asp:Content>
